﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Drawing;

namespace Tesla.Util.UIUtilities
{
   public class TeslaRadioButton:RadioButton
    {

        #region overridden methods

        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            base.AddAttributesToRender(writer);
            writer.AddAttribute("_Dirty", "false");
        }
        protected override void OnPreRender(EventArgs e)
        {
            if (!Page.ClientScript.IsClientScriptBlockRegistered("ValidateDropdown"))
                Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "Setting_Dirty", "function Setting_Dirty(ct1)" + "{document.getElementById(ct1).setAttribute(\"_Dirty\",\"true\");}", true);
            //base.OnPreRender(e);
        }
        protected override void Render(HtmlTextWriter writer)
        {
            this.Attributes.Add("onClick", "Setting_Dirty('" + this.ID + "')");
            base.Render(writer);
        }

        #endregion

    
    
    
    }
}
